package com.xh.service;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.xh.common.ResultCode;
import com.xh.dao.UserMapper;
import com.xh.model.User;

@Service
public class HelloWoldService {

	@Autowired
	private UserMapper userMapper;
	
	public ResultCode getUserList(){
		ResultCode resultCode=new ResultCode();
		List<User> userList=userMapper.getUserList();
		if(userList.size()>0){
			resultCode.setRemark("查询成功");
			resultCode.setResult(userList);
		}else{
			resultCode.setCode(-1);
			resultCode.setRemark("没有相关数据");
			resultCode.setResult(null);
		}
		return resultCode;
	}
}
